package com.peaker.advertisingpro.activity

import android.app.ActivityManager
import android.content.Context
import android.os.Bundle
import android.text.format.Formatter
import com.peaker.advertisingpro.R
import com.peaker.advertisingpro.base.BaseActivity
import com.peaker.advertisingpro.utils.Common
import com.peaker.advertisingpro.utils.SPUtil
import com.peaker.advertisingpro.utils.SmdtManagerUtils
import com.peaker.advertisingpro.utils.ToastUtils.context
import kotlinx.android.synthetic.main.activity_app_info_layout.*
import java.text.SimpleDateFormat
import java.util.*


class appinfoActivity : BaseActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_app_info_layout)
        setText()

    }

    private fun setText() {
        var simpleDateFormat = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
        var nowDate = simpleDateFormat.format(Date())

        var default = TimeZone.getDefault()
        var zoneStr=default.getDisplayName(false,TimeZone.SHORT)+default.id

        var packageInfo = packageManager.getPackageInfo(this.packageName, 0)


        info_app_version.text="版本号 "+SmdtManagerUtils.getFormattedKernelVersion()+"\n "
        app_version.text="APP版本: ${packageInfo.versionName}"
        info_hard_version.text="Android/${SmdtManagerUtils.getDeviceBrand()}"+SmdtManagerUtils.getAndroidModel()+"/"+SmdtManagerUtils.getAndroidVersion()
        info_memory.text="内置SD: "+"(可用)${SmdtManagerUtils.getAvailableMemory()}/"+SmdtManagerUtils.getInternalStorageMemory()+"(总共大小)"
        info_time.text=nowDate
        info_shiqu.text=zoneStr
        info_ai_module.text=""
        info_liangdu.text="当前亮度: ${SmdtManagerUtils.getScreenBrightness()}   最大亮度: 100"
        info_volume.text="当前音量: ${SmdtManagerUtils.getCurrentSysVolume()}    最大音量: 100"
        info_mac.text=SmdtManagerUtils.smdtGetEthMacAddress()
        var sp = SPUtil.getSP(Common.AUTH, "无")
        info_auth.text="$sp"
        info_camera.text=""

    }



}
